package com.zhenghaijin.searchservice.model;

import java.util.List;

// 分页结果封装
public class PageResult<T> {
    private Long total;       // 总记录数
    private List<T> records;  // 当前页数据
    private Integer page;     // 当前页码
    private Integer size;     // 每页大小

    public PageResult() {}

    public PageResult(Long total, List<T> records, Integer page, Integer size) {
        this.total = total;
        this.records = records;
        this.page = page;
        this.size = size;
    }

    // Getter 和 Setter
    public Long getTotal() {
        return total;
    }

    public void setTotal(Long total) {
        this.total = total;
    }

    public List<T> getRecords() {
        return records;
    }

    public void setRecords(List<T> records) {
        this.records = records;
    }

    public Integer getPage() {
        return page;
    }

    public void setPage(Integer page) {
        this.page = page;
    }

    public Integer getSize() {
        return size;
    }

    public void setSize(Integer size) {
        this.size = size;
    }
}
